import request from '../../utils/request'

/**
 * 分页查询客户营销线索列表
 * 
 */
export async function queryMarketInfos({ companyName, companyNo, status, page }) {
    return request(apiPath.mc + "/api/market", {
        method: 'get',
        data: { companyName, companyNo, status, page: page.page }
    });
}

/**
 * 新增工作追踪
 * 
 */
export async function createMarketInfo({ dataSource }) {
    return request(apiPath.mc + "/api/market", {
        method: 'post',
        data: { ...dataSource }
    });
}


/**
 * 修改营销线索
 * 
 */
export async function updateMarketInfo({ dataSource }) {
    return request(apiPath.mc + '/api/market', {
        method: 'put',
        data: { ...dataSource }
    });
}


/**
 * 删除营销线索
 * 
 */
export async function deleteMarketInfoById({ id }) {
    return request(apiPath.mc + '/api/market/' + id, {
        method: 'delete',
    });
}


/**
 * 根据id获取营销线索
 * @param id
 * @returns {Promise.<void>}
 */
export async function getMarketInfoById({ id }) {
    return request(apiPath.mc + '/api/market/' + id, {
        method: 'get'
    });
}


/**
 * 根据客户查询营销线索
 * @param cId
 * @returns {Promise.<void>}
 */
export async function queryMarketListByCId({ cId, page }) {
    return request(apiPath.mc + "/api/market/" + cId + "/company", {
        method: 'get',
        data: { page: page.page, size: page.size }
    });
}